Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes undefined variable references #14

Merged
merged 2 commits into from Sep 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -62,10 +62,10 @@ function FcController(options) {
}
if (req.query.devMode === "WITH_ENDOFNIR") {
if (req.query.endOfNir) {
return ApirServiceInstance.putEndOfNir(identity, req.query.endOfNir);
return ApirService.putEndOfNir(identity, req.query.endOfNir);
}
else {
return ApirServiceInstance.getEndOfNir(identity);
return ApirService.getEndOfNir(identity);
}
}
else {
@@ -15,14 +15,14 @@ function FieldsController(options) {
const DataModel = new dataModel(options);
const FlashHelper = new flashHelper(options);

this.index = function(req, res) {
this.index = function(req, res, next) {
if (req.data.route.fields.length == 0)
return res.redirect('/dashboard/services/' + req.data.service.nameNormalized + '/routes/' + req.data.route.nameNormalized + '/fields/new');
FieldModel.io.find({route: req.data.route})
.sort({createdAt: -1})
.exec(function(err, fields) {
if (err)
next(err);
return next(err);
return res.render('pages/dashboard/fields/index', {
page: 'pages/dashboard/fields/index',
csrfToken: req.csrfToken(),
@@ -19,12 +19,12 @@ function RoutesController(options) {
const RelationModel = new relationModel(options);
const FlashHelper = new flashHelper(options);

this.index = function(req, res) {
this.index = function(req, res, next) {
RouteModel.io.find({service: req.data.service})
.sort({createdAt: -1})
.exec(function(err, routes) {
if (err)
next(err);
return next(err);
return res.render('pages/dashboard/routes/index', {
page: 'pages/dashboard/routes/index',
csrfToken: req.csrfToken(),
@@ -129,7 +129,7 @@ function RoutesController(options) {
}
], function(err, result) {
if (err)
return self.destroy(err);
return next({code: 500});
return res.render('pages/dashboard/routes/view', {
page: 'pages/dashboard/routes/view',
csrfToken: req.csrfToken(),
@@ -236,7 +236,7 @@ function RoutesController(options) {
return next();
});
};

this.getRouteData = function(req, res, next) {
RouteModel.io.findOne({
service: req.data.service,
@@ -150,7 +150,7 @@ function ServicesController(options) {
});
};

this.revokeUser = function(req, res) {
this.revokeUser = function(req, res, next) {
const userEmail = req.params.userEmail;
UserModel.io.findOne({
email: userEmail
@@ -12,12 +12,12 @@ function TokensController(options) {
const TokenModel = new tokenModel(options);
const FlashHelper = new flashHelper(options);

this.index = function(req, res) {
this.index = function(req, res, next) {
TokenModel.io.find({service: req.data.service})
.sort({createdAt: -1})
.exec(function(err, tokens) {
if (err)
next(err);
return next(err);
return res.render('pages/dashboard/tokens/index', {
page: 'pages/dashboard/tokens/index',
csrfToken: req.csrfToken(),
@@ -19,7 +19,7 @@ module.exports = function (options) {
const RoutesController = new routesController(options);
const FieldsController = new fieldsController(options);
const DatasController = new datasController(options);

router.all('/*', function(req, res, next) {
res._jsonapi = {
version: "1.0"
@@ -21,7 +21,7 @@ function ApirService(options) {

this.getEndOfNir = function(idp)
{
const idpHash = idpToHash(idp);
const idpHash = this.idpToHash(idp);

return new Promise(function(resolve, reject) {
request
@@ -50,7 +50,7 @@ function ApirService(options) {

this.putEndOfNir = function(idp, endOfNir)
{
const idpHash = idpToHash(idp);
const idpHash = this.idpToHash(idp);

return new Promise(function(resolve, reject) {
request